﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:Snipps.Controls">

    <Style TargetType="{x:Type Controls:CircuralIndicator}">

        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Color" Value="{DynamicResource ForegroundColor}" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:CircuralIndicator}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="Storyboard1"
                                    RepeatBehavior="Forever">
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_Ellipse"
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                      Value="359" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid x:Name="LayoutRoot">
                        <Ellipse x:Name="PART_Ellipse"
                                 RenderTransformOrigin="0.5,0.5">
                            <Ellipse.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                    <SkewTransform />
                                    <RotateTransform />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Ellipse.RenderTransform>

                        </Ellipse>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsVisible" Value="true">
                            <Trigger.EnterActions>
                                <BeginStoryboard x:Name="Storyboard1_BeginStoryboard"
                                                 Storyboard="{StaticResource Storyboard1}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <StopStoryboard x:Name="Storyboard1_BeginStoryboard22"
                                                BeginStoryboardName="Storyboard1_BeginStoryboard" />
                            </Trigger.ExitActions>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>

            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>